Ext.define('cloud.controller.PhotosWallController', {
    extend: 'Ext.app.Controller',
    config: {
        file: '',
        refs: {
            photoswall:'photosWall',
            photolist: 'photosWall list',
            photodetail:'photoDetail'
        },
        control: {
            /**
             * show categoryedit page
             */
            photolist: {
                itemtap: function (list, item, index, record) {
                    Ext.Viewport.mask({xtype: 'loadmask'});
                    var pDetail = this.getPhotodetail() || Ext.create('cloud.view.photoswall.PhotoDetail');
                    console.log(record);
                    Ext.getCmp("imgid").setValue(record.data.id);
                    Ext.getCmp("imgcaption").setValue(record.data.caption);
                    Ext.getCmp("imgshow").setHtml("<div style='margin:20px auto;width: 70%; height: 600px'><img src='"+record.data.image+"' width='100%' height='100%'/></div>");
                    this.getPhotoswall().push(pDetail);
                    Ext.Viewport.unmask();
                }
            }
        }
    }
});